<template>
  <view class="container">
    <view class="top-bar">
      <navigator class="back-btn" url="/pages/regularUser/regularUser" >←</navigator>
      <text class="title">用药提醒</text>
    </view>
    <view class="medicine-list">
      <view class="medicine-item" v-for="(medicine, index) in medicineList" :key="index">
        <view class="medicine-name">{{ medicine.name }}</view>
        <view class="medicine-details">
          <text>剂量: {{ medicine.dosage }}</text>
          <text>服用时间: {{ medicine.time }}</text>
        </view>
      </view>
    </view>
    <button class="add-button" @click="goAdd">添加用药信息</button>
  </view>
</template>

<script>
export default {
  data() {
    return {
      medicineList: [
        { name: "降压药", dosage: "1片", time: "早上8点" },
        { name: "降糖药", dosage: "2片", time: "饭前30分钟" },
        { name: "感冒药", dosage: "1包", time: "晚上睡前" }
      ]
    };
  },
   methods: {
	  goAdd(){
		  uni.navigateTo({
		  	url:"/pages/regularUser/quickFuction/takeMedicine/addMedicineInfo/addMedicineInfo"
		  })
	  }
  }
};
</script>

<style scoped>
.container {
  background-color: #fff3e0;
  width: 100vw;
  height: 100vh;
}

.top-bar {
  padding: 15px 20px;
  background-color: #FD995E;
  display: flex;
  align-items: center;
  height: 60px;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
}

.back-btn {
  font-size: 24px;
  color: white;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.2);
}

.title {
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-align: center;
  flex: 1;
}


.medicine-list {
  background-color: #fff3e0;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.medicine-item {
  background-color: #fff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.medicine-name {
  font-size: 18px;
  font-weight: bold;
  color: #ff9800;
  margin-bottom: 5px;
}

.medicine-details {
  font-size: 14px;
  color: #666;
}

.add-button {
  background-color: #FD995E;
  color: #fff;
  font-size: 16px;
  width: 90vw;
  height: 60px;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  border: none;
}
</style>